<?php

namespace app\home\controller;

use think\facade\Request;
use think\Controller;


class Send extends Base
{
    public function send()
    {
        $param = Request::param();
        // $this->ok($param['userid']);
        $data = [
            'userid' => $param['userid'],
            'username' => $param['name'],
            'address' => $param['address'],
            'phone' => $param['phone']
        ];
        $res = \app\home\model\Address::where('userid', $param['userid'])->insert($data);

        if (!$res) {
            $this->fail();
        }
        $this->ok($res);
    }
    public function getAddress()
    {

        // $this->ok('aaaaa');
        $id = Request::param();
        $data = \app\home\model\Address::select();
        $this->ok($data);
    }
}
